<style>
    
</style>

<?if((isset($user_info['id']) && (!$user_info['first_name'] || !$user_info['last_name'])) || get("me")):?>
    <div id="addname">
        <div id="close_addname"><img src="<?=BASE_URL;?>source/img/close.png"></div>
        <div class="clear"></div>
        <form action="<?=BASE_URL;?>" method="post">
            <input type="hidden" name="update_name" value="1" />
            <input type="hidden" name="uid" value="<?=$user_info['id'];?>" />
            <table>
                <tr>
                    <td style="text-align: center; color: #FFFFFF;">Имя</td>
                    <td style="text-align: center; color: #FFFFFF;">Фамилия</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td><input type="text" value="<?=$user_info['first_name'];?>" name="first_name" /></td>
                    <td><input type="text" value="<?=$user_info['last_name'];?>" name="last_name" /></td>
                    <td><input type="submit" value="Обновить" /></td>
                </tr>
            </table>
        </form>
    </div>
<?endif;?>
<div class="row"><a href="<?=$prev_month_link;?>"><img src="<?=BASE_URL;?>source/img/arrow_left.png" style="height: 16px;" /></a><span class="title"><?= $months[$month - 1] . "." . $year; ?></span><a href="<?=$next_month_link;?>"><img style="height: 16px;" src="<?=BASE_URL;?>source/img/arrow_right.png" /></a></div>
<div class="today_menu"><span class="today_menu_date"><?=date("d.m");?></span><br /><?=$today_menu['fc'];?><br /><?=$today_menu['mc'];?></div>
<div class="row" style="height: 45px;">
    <div class="whitespace_title">&nbsp;</div>
    <? foreach ($dates as $key => $date): ?>
        <div id="<?= $date['date']; ?>" class="<? if (!in_array($date['day'], array(0, 6))): ?>calendar calendar_enabled <? else: ?>calendar_disabled weekend<? endif; ?> <?if($date['date'] == date("Y-m-d")):?>today<?endif;?>"><?= substr($date['date'], 8); ?><hr /><?= $days[$date['day']]; ?></div>
    <? endforeach; ?>
    <div class="whitespace">&nbsp;</div>
</div>
<? foreach ($users as $user): ?>
    <div class="order_row">
        <div class="username"><?= $user['short_name']; ?></div>
        <? foreach ($dates as $key => $date): ?>
            <div id="<?= $user['id'] . "__" . $date['date']; ?>" class="date_<?= $date['date']; ?> <? if (!in_array($date['day'], array(0, 6))): ?>order <? else: ?> <?if(in_array($date['day'], array(0, 6))):?> weekend <?endif;?> disabled_order<? endif; ?> <?if($date['date'] == date("Y-m-d")):?>today<?endif;?> <?if($user['id'] == $user_info['id']):?>me<?endif;?>"><?= $order_options[$food[$user['id']][$date['date']]]; ?></div>
        <? endforeach; ?>
        <div class="summary_by_user"><?if($user_info['admin'] || $user_info['id'] == $user['id']):?>П: <?=$user['summary']['0.4'];?> В: <?=$user['summary']['0.5'];?> Сумма: <?=$user['summary']['cash'];?><?else:?>&nbsp;<?endif;?></div>
    </div>
<? endforeach; ?>
<div class="row">
    <div class="total_title">Первых</div>
    <? foreach ($dates as $key => $date): ?>
        <div id="total_fc_<?=$date['date'];?>" class="total_order <?if($date['date'] == date("Y-m-d")):?>today<?endif;?>"><?= $total[$date['date']]['0.4']; ?></div>
    <? endforeach; ?>
    <div class="whitespace">&nbsp;</div>
</div>
<div class="row">
    <div class="total_title">Вторых</div>
    <? foreach ($dates as $key => $date): ?>
    <div id="total_mc_<?=$date['date'];?>" class="total_order <?if($date['date'] == date("Y-m-d")):?>today<?endif;?>"><?= $total[$date['date']]['0.5']; ?></div>
    <? endforeach; ?>
    <div class="whitespace">&nbsp;</div>
</div>